﻿<xsl:stylesheet version="1.0" 
	xmlns:date="http://exslt.org/dates-and-times"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="date">

<xsl:output omit-xml-declaration="yes" />

<xsl:param name="IsBlogOwner" />
<xsl:param name="RelativeUrl" />

<xsl:template match="/">
	<a name="postComments"> </a>
	
	<h2>Comments</h2>
	<xsl:apply-templates select="rows/row"/>
</xsl:template>

<xsl:template match="row">
	<xsl:variable name="publishedDate" select="date:parseDate(Created, 'yyyy-MM-dd HH:mm:ss')"/>
	
	<div id="comments">
		<p><xsl:value-of select="Body" disable-output-escaping="yes" /></p>
	
		<p class="postingdetail">
			<xsl:value-of select="date:format-date($publishedDate, 'EEEE, d MMM yyyy hh:mm')"/>
			by 
      <xsl:choose>
				<xsl:when test="CommentUrl != ''">
					<a>
						<xsl:attribute name="href">
							<xsl:if test="starts-with(CommentUrl, 'http') = false">
								http://
							</xsl:if>
							<xsl:value-of select="CommentUrl" />
						</xsl:attribute>
						<xsl:value-of select="Title"/>
					</a>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="Title"/>
				</xsl:otherwise>
			</xsl:choose>
		</p>
	</div>

</xsl:template>
  
</xsl:stylesheet>
